package types

// State represents the possible states of an agent
type State string

const (
	StateUninitialized State = "uninitialized"
	StateIdle          State = "idle"
	StateWorking       State = "working"
	StatePaused        State = "paused"
	StateError         State = "error"
	StateRestarting    State = "restarting"
	StateFinished      State = "finished"
)

// String returns the string representation of the state
func (s State) String() string {
	return string(s)
}

// IsValid checks if the state is valid
func (s State) IsValid() bool {
	switch s {
	case StateUninitialized, StateIdle, StateWorking, StatePaused, StateError, StateRestarting, StateFinished:
		return true
	default:
		return false
	}
}
